const express = require('express');
const LoginService = require('./../services/login');
const LoginDao = require('./../dao/login');

const loginRoute = express.Router();
const loginService = new LoginService(new LoginDao());

loginRoute.post('/', (req, res, next) => {
  loginService.login(req.body).then(data => {
    console.log(data);
    req.middleData = data;
    next();
  });
});

module.exports = loginRoute;

